use entity::entities::cake;
use migration::{Migrator, MigratorTrait};
use sea_orm::{ActiveModelBehavior, ActiveModelTrait, DbErr, Set};
use sea_orm_migrate::get_connection;

#[tokio::main]
async fn main() -> Result<(), DbErr> {

    let db = get_connection().await;
    Migrator::up(&db, None).await?;

    let mut model = cake::ActiveModel::new();
    model.name = Set("草莓蛋糕".to_string());
    model.insert(&db).await?;
    Ok(())
}
